package com.makingTeam.server.controller;


import com.makingTeam.comment.annotation.ApiLog;
import com.makingTeam.comment.enums.OperateEnum;
import com.makingTeam.comment.result.JsonResult;
import com.makingTeam.config.disruptor.DisCustomServer;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author pzy
 * @since 2022-08-03
 */
@RestController
@RequestMapping("/system/goods2")
public class Goods2Controller {

    @Resource
    private DisCustomServer disCustomServer;

    @PostMapping("/sendDis")
    @ApiLog(method = "使用disruptor队列发送信息",type= OperateEnum.OTHER)
    public JsonResult<Object> sendDis(String message) throws InterruptedException {
        disCustomServer.onData(message);
        return JsonResult.success("发送成功",null);
    }

}

